/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.iwords.service.object;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.Transient;

/**
 *
 * @author huangbaichuan
 */
@Entity
@Table(name = "syslibwords")
public class SysLibWordsEntity implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long wordid;
    private Long libid;
    private String spelling;
    private String phonetics;
    private String meaning;
    @Transient
    private long num;
    @Transient
    private List<String> sens = null;
    @Temporal(javax.persistence.TemporalType.TIME)
    private Date createtime;
    @Temporal(javax.persistence.TemporalType.TIME)
    private Date updatetime;
    
    
     @Transient
    private String partSpeechs = null;

     
     public void setPartSpeechs(String partSpeechs){
         this.partSpeechs=partSpeechs;
     }
     
     public String getPartSpeechs(){
     return partSpeechs;
             
     }
    /**
     * @return the num
     */
    public long getNum() {
        return num;
    }

    /**
     * @param num the num to set
     */
    public void setNum(long num) {
        this.num = num;
    }

    /**
     * @return the libid
     */
    public Long getLibid() {
        return libid;
    }

    /**
     * @param libid the libid to set
     */
    public void setLibid(Long libid) {
        this.libid = libid;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public String getMeaning() {
        return meaning;
    }

    public void setMeaning(String meaning) {
        this.meaning = meaning;
    }

    public String getPhonetics() {
        return phonetics;
    }

    public void setPhonetics(String phonetics) {
        this.phonetics = phonetics;
    }

    public String getSpelling() {
        return spelling;
    }

    public void setSpelling(String spelling) {
        this.spelling = spelling;
    }

    /**
     * @return the wordid
     */
    public Long getWordid() {
        return wordid;
    }

    /**
     * @param wordid the wordid to set
     */
    public void setWordid(Long wordid) {
        this.wordid = wordid;
    }

    public Date getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(Date updatetime) {
        this.updatetime = updatetime;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (wordid != null ? wordid.hashCode() : 0);
        return hash;
    }

    /**
     * @return the sens
     */
    public List<String> getSens() {
        return sens;
    }

    /**
     * @param sens the sens to set 
     */
    public void setSens(List<String> sens) {
        this.sens = sens;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SysLibWordsEntity)) {
            return false;
        }
        SysLibWordsEntity other = (SysLibWordsEntity) object;
        if ((this.wordid == null && other.wordid != null) || (this.wordid != null && !this.wordid.equals(other.wordid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.iwords.service.object.SysLibWordsEntity[id=" + wordid + "]";
    }

    public static void main(String[] args) {
        String l = "The sad news of her father's death was the only cloud on an otherwise happy year.#她父亲的死讯是她愉快的一年中唯一伤心的事。";
        String s[] = l.split("#");
        System.out.println(s.length);
        System.out.println(s[0]);
        System.out.println(s[1]);
    }
}
